package org.micode.common.domain.vo;

import lombok.Data;

import javax.validation.constraints.NotNull;

@Data
public class EditObjVO<T> {

    @NotNull
    private T wantEdit;

    @NotNull
    private Long updUser;

    @NotNull
    private String updProg;

    @NotNull
    private String updIp;

    /**
     * 潜规则: 需要系列化的对象必须定义一个无参构造函数
     */
    public EditObjVO() {
    }

    public EditObjVO(T wantEdit,
                     Long updateUser,
                     String updateProg,
                     String updateIp) {
        this();
        this.wantEdit = wantEdit;
        this.updUser = updateUser;
        this.updProg = updateProg;
        this.updIp = updateIp;
    }

    public String getUpdProg() {
        return null == updProg ? "" : updProg;
    }

    public String getUpdIp() {
        return null == updIp ? "" : updIp;
    }

}
